<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
	#out{
		width: 800px;
		height: 600px;
		border: 5px solid blue;
		margin: 10px auto;
		position: relative;
	}
	#in{
		width: 200px;
		height: 160px;
		background: purple;
		position: absolute;
		left: 200px;
		top: 100px;
		z-index: 5;
	}
	#hd{
		width: 300px;
		height: 200px;
		background: green;
		position: absolute;
		top: 200px;
		left: 300px;
		z-index: 6;
	}
</style>
</head>

<body>
<!-- 有定位属性的元素才有层级的概念，定位元素默认的层级都是0,谁来的晚谁在上面。 -->
<div id="out">
	<div id="in"></div>
	<div id="hd"></div>
</div>

</body>
</html>
